package com.hlmc.service.task;

import com.hlmc.service.Query_360_Service;
import com.hlmc.spider.*;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.Spider;

import javax.annotation.Resource;

@Component("SourceTask")
public class Task_360 {
        @Resource
        private DM360_dt_spider dm_360spider;
       @Resource
        private DS_pipeline ds_pipeline;

    @Resource
    private Rank_pipeline rank_pipeline;

       @Resource
       private Rank_spider rank_spider;

       @Resource
        private DS360_dt_spider ds_360spider;
        @Resource
        private Zy2_spider zy2_spider;
        @Resource
        private Zy2_pipeline zy2_pipeline;
       @Resource
        private DY360_dt_spider dy_360spider;
       @Resource
       private YunVideo_spider yun_spider;

       @Resource
       private yun_pipeline yun_pipeline;

       @Resource
       private FuLi_spider fl_spider;
       @Resource
       private FuLi_pipeline fl_pipeline;

       @Resource
       private Query_360_Service query_360;

    @Scheduled(cron = "0 50 22 * * ?")
    public void Zy2Source() {
        try{
            Spider.create(zy2_spider).addUrl("http://yongjiuzy.cc/")
                    .addPipeline(zy2_pipeline)
                    .thread(5).run();
        }catch (Exception e){
            e.printStackTrace();
        }
    }

}